import config from '@/config/index.js'
export default{
	logOut(s){
		s.user=null
		window.localStorage.removeItem("authorization")
	},
	setUser(s,user){
		console.log("user",user)
		if(user){
			let res=user.head
			if(res&&!res.startsWith("http://")&&!res.startsWith("https://")){
				user.head=config.STATIC_URL+res
			}
			window.localStorage.setItem("authorization",user.token)
			s.user=user
		}
	}
}